/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package alcatelparser.tags;

import alcatelparser.modules.BuilderFactory;
import alcatelparser.modules.I;

/**
 *
 * @author geniuz
 */
public class UUInfoTag extends DefaultParserTag
{

    public UUInfoTag()
    {
    }

    public final void parseTag(int ai[], int i)
    {
        setStandartLength(ai, i);/*
        _array = ai;
        _startParsePosition = i;
        if(isFullForm())
        {
            BuilderFactory.getBuilder().writeTagContent(3, 0, getTagPropertiesValue(I.I(6033)), getTagIdentifyContent(i, i + 1));
            BuilderFactory.getBuilder().writeTagContent(4, 0, getTagPropertiesValue(I.I(6044)), getTagIdentifyContent(i + 2, i + 3));
        }
        _curSubPosition = i + 4;
        parseReceivedMessages();
        parseTransmittedMessages();*/
    }

    private void parseReceivedMessages()
    {
        if(isFullForm())
        {
            String s = (new StringBuilder()).append(getTagIdentifyContent(_curSubPosition, _curSubPosition + 1)).append(getContent(_curSubPosition + 2, _array[_curSubPosition + 1])).toString();
            BuilderFactory.getBuilder().writeTagContent(5, 0, getTagPropertiesValue(I.I(2960)), s);
        }
        _curSubPosition += _array[_curSubPosition + 1] + 2;
    }

    private void parseTransmittedMessages()
    {
        if(isFullForm())
        {
            String s = (new StringBuilder()).append(getTagIdentifyContent(_curSubPosition, _curSubPosition + 1)).append(getContent(_curSubPosition + 2, _array[_curSubPosition + 1])).toString();
            BuilderFactory.getBuilder().writeTagContent(5, 0, getTagPropertiesValue(I.I(3009)), s);
        }
    }

    private String getContent(int i, int j)
    {
        int k = 0;
        for(int l = 0; l < j; l++)
            k <<= 8 + _array[i + l];

        return (new StringBuilder()).append("").append(k).toString();
    }

    public final String getParseIdentityTag()
    {
        return I.I(6030);
    }

    private int _curSubPosition;
}
